// SPDX-FileCopyrightText: Copyright 2025-2025 深圳市同心圆网络有限公司
// SPDX-License-Identifier: GPL-3.0-only

package service_impl

type ERROR_CODE string

const (
	ERROR_CODE_BLOB_UNKNOWN          = ERROR_CODE("BLOB_UNKNOWN")
	ERROR_CODE_BLOB_UPLOAD_INVALID   = ERROR_CODE("BLOB_UPLOAD_INVALID")
	ERROR_CODE_BLOB_UPLOAD_UNKNOWN   = ERROR_CODE("BLOB_UPLOAD_UNKNOWN")
	ERROR_CODE_DIGEST_INVALID        = ERROR_CODE("DIGEST_INVALID")
	ERROR_CODE_MANIFEST_BLOB_UNKNOWN = ERROR_CODE("MANIFEST_BLOB_UNKNOWN")
	ERROR_CODE_MANIFEST_INVALID      = ERROR_CODE("MANIFEST_INVALID")
	ERROR_CODE_MANIFEST_UNKNOWN      = ERROR_CODE("MANIFEST_UNKNOWN")
	ERROR_CODE_MANIFEST_UNVERIFIED   = ERROR_CODE("MANIFEST_UNVERIFIED")
	ERROR_CODE_NAME_INVALID          = ERROR_CODE("NAME_INVALID")
	ERROR_CODE_NAME_UNKNOWN          = ERROR_CODE("NAME_UNKNOWN")
	ERROR_CODE_SIZE_INVALID          = ERROR_CODE("SIZE_INVALID")
	ERROR_CODE_TAG_INVALID           = ERROR_CODE("TAG_INVALID")
	ERROR_CODE_UNAUTHORIZED          = ERROR_CODE("UNAUTHORIZED")
	ERROR_CODE_DENIED                = ERROR_CODE("DENIED")
	ERROR_CODE_UNSUPPORTED           = ERROR_CODE("UNSUPPORTED")
)

type Error struct {
	Code    ERROR_CODE `json:"code"`
	Message string     `json:"message"`
	Detail  any        `json:"detail,omitempty"`
}

type ErrorList struct {
	Errors []Error `json:"errors"`
}
